/*
@STI LICENSE
(C) 2006-2008 Universit�t Innsbruck.

This file is part of myOntology.

myOntologyis free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

myOntologyis distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with myOntology.  If not, see <http://www.gnu.org/licenses/>.

@STI LICENSE */
package org.myontology.controller.impl;

import org.apache.log4j.Logger;
import org.hibernate.classic.Session;
import org.myontology.controller.DIController;
import org.myontology.controller.LogProvider;
import org.myontology.controller.MailProvider;
import org.myontology.controller.Mailer;
import org.myontology.controller.SesameProvider;
import org.myontology.controller.SesameSession;
import org.myontology.controller.rules.SimpleRuleEngine;
import org.myontology.controller.rules.impl.MyRules;
import org.myontology.db.HibernateSessionProvider;
import org.myontology.logging.ElementLogging;
import org.myontology.logging.ElementLoggingProvider;
import org.myontology.model.SubjectValidatorProvider;
import org.myontology.specialpages.SpecialPageRegistry;
import org.myontology.specialpages.dynamic.DynamicSpecialPageRegistry;
import org.myontology.users.CheckCaptcha;
import org.myontology.users.UserAlreadyExitsValidator;

public class MyOntologyDIController extends DIController{

	public MyOntologyDIController() {
		init();
	}

	private void init() {
		implement(Logger.class, new LogProvider());
		
		implement(ElementLogging.class,new ElementLoggingProvider());
		implement(Session.class,new HibernateSessionProvider());
		implement(SpecialPageRegistry.class, new DynamicSpecialPageRegistry());
		implement(SesameSession.class, new SesameProvider());
		
		implement(CheckCaptcha.class, new SubjectValidatorProvider(CheckCaptcha.class));
		implement(UserAlreadyExitsValidator.class, new SubjectValidatorProvider(UserAlreadyExitsValidator.class));
		implement(SimpleRuleEngine.class, new MyRules());
		
		implement(Mailer.class, new MailProvider());
	}
	
}
